﻿@using DevExpress.Web.Mvc.UI
@using Dogshow.Model
@using Dogshow.Web.Utils
@model KinoloskoDrustvo
 
<div class="line">
    @Html.DevExpress().HyperLink(
        s =>
            {
                s.Name = "lnkNoviUnos";
                s.Properties.Text = "Novi unos";
                s.Properties.Style.Cursor = "Pointer";
                s.Properties.ClientSideEvents.Click = "onNoviUnos";
            }
    ).GetHtml()
</div>           
@using (Html.BeginForm("Azuriraj", "KinoloskaDrustva", FormMethod.Post, new { @class = "edit_form" }))
{
    @Html.HiddenFor(x => x.Id)
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "Naziv:";
                        s.AssociatedControlName = "Naziv";
                    }
                ).GetHtml()
            @Html.DevExpress().TextBox(
                    s =>
                    {
                        s.Name = "Naziv";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ConvertEmptyStringToNull = true;
                        s.ShowModelErrors = true;
                        s.ToolTip = "Naziv kinološkog društva";
                    }).Bind(Model.Naziv).GetHtml()
    </div>
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "Adresa:";
                        s.AssociatedControlName = "Adresa";
                    }
                ).GetHtml()
            @Html.DevExpress().TextBox(
                    s =>
                    {
                        s.Name = "Adresa";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ConvertEmptyStringToNull = true;
                        s.ShowModelErrors = true;
                    }).Bind(Model.Adresa).GetHtml()
        </div>
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "Mesto:";
                        s.AssociatedControlName = "IdMesta";
                    }
                ).GetHtml()
            @Html.PartialOrNull("MestaCombo", Model.IdMesta)
        </div>
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "Telefon:";
                        s.AssociatedControlName = "Telefon";
                    }
                ).GetHtml()
            @Html.DevExpress().TextBox(
                    s =>
                    {
                        s.Name = "Telefon";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ConvertEmptyStringToNull = true;
                        s.ShowModelErrors = true;
                    }).Bind(Model.Telefon).GetHtml()
        </div>
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "Faks:";
                        s.AssociatedControlName = "Faks";
                    }
                ).GetHtml()
            @Html.DevExpress().TextBox(
                    s =>
                    {
                        s.Name = "Faks";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ConvertEmptyStringToNull = true;
                        s.ShowModelErrors = true;
                    }).Bind(Model.Faks).GetHtml()
            @Html.ValidationMessageFor(x => x.Faks)
        </div>
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "E-Mail:";
                        s.AssociatedControlName = "EMail";
                    }
                ).GetHtml()
            @Html.DevExpress().TextBox(
                    s =>
                    {
                        s.Name = "EMail";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ConvertEmptyStringToNull = true;
                        s.ShowModelErrors = true;
                    }).Bind(Model.EMail).GetHtml()
            @Html.ValidationMessageFor(x => x.EMail)
        </div>
    <div class="line">
            @Html.DevExpress().Label(
                    s =>
                    {
                        s.ControlStyle.CssClass = "label";
                        s.Text = "Tekući račun:";
                        s.AssociatedControlName = "TekuciRacun";
                    }
                ).GetHtml()
            @Html.DevExpress().TextBox(
                    s =>
                    {
                        s.Name = "TekuciRacun";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ConvertEmptyStringToNull = true;
                        s.Properties.DisplayFormatString = "###-0000000000000-##";
                        s.Properties.DisplayFormatInEditMode = true;
                        s.ShowModelErrors = true;
                    }).Bind(Model.TekuciRacun).GetHtml()
        </div>
    <div class="line">
        @Html.DevExpress().Button(
            s =>
            {
                s.Name = "btnSubmit";
                s.Text = "Sačuvaj";
                s.ControlStyle.CssClass = "btnSave";
                s.ClientSideEvents.Click = "onSubmit";
            }).GetHtml()
    </div>
}